<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>西藏欢迎你</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.min.css">
    <script src="${pageContext.request.contextPath}/js/jquery-3.6.0.min.js"></script>
    <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
    <script src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
    <!-- Bootstrap -->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.css"/>
    <%--引入echarts--%>
    <script src="${pageContext.request.contextPath}/js/echarts.js"></script>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/index.css">
</head>

<script>console.log(`${dateByLimit}`)</script>
<body>
<div class="">
    <div class="header">
        <%@ include file="pub/header.jsp" %>
        <div class="carouse">
            <div id="myCarousel" class="carousel slide" data-interval="2000"  data-ride="carousel">
                <!-- 轮播（Carousel）项目 -->
                <div class="carousel-inner">
                    <div class="item active">
                        <img src="${pageContext.request.contextPath}/img/index/Banner (1).png" alt="First slide">
                    </div>
                    <div class="item">
                        <img src="${pageContext.request.contextPath}/img/index/Banner (2).png" alt="Second slide">
                    </div>
                </div>
                <!-- 轮播（Carousel）导航 -->
                <a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
                    <img src="${pageContext.request.contextPath}/img/index/011.png"
                         style="position: absolute;float: left;top: 45%;left: 8%;width: 50px">
                    <span class="sr-only">Previous</span>
                </a>
                <a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
                    <img src="${pageContext.request.contextPath}/img/index/022.png"
                         style="float: right;position: absolute;top: 45%;right: 8%;width: 50px ">
                    <span class="sr-only">Next</span>
                </a>
            </div>
        </div>
        <div class="nav">
            <div class="container">

                <div class="row">
                    <a class="col-md-3 col-xs-6 active" href="${pageContext.request.contextPath}/index">首&nbsp;页</a>
                    <a class="col-md-3 col-xs-6" href="${pageContext.request.contextPath}/user/news">新闻资讯</a>
                    <a class="col-md-3 col-xs-6" href="${pageContext.request.contextPath}/re_approve/item">办事大厅</a>
                    <a class="col-md-3 col-xs-6"
                       href="${pageContext.request.contextPath}/item/revealFull">公示信息</a>
                </div>
            </div>
        </div>
    </div>
    <div class="frist">
        <div class="container">
            <div class="row">
                <c:if test="${userInfo == null}">
                    <div class="col-md-8  col-xs-12">
                        <div class="l_frist">
                            <div class="title">
                                <span class="one">项目办理结果公示</span>
                                <a class="two" href="item/revealFull">更多&nbsp;<i class="iconfont"
                                                                                 style="font-size: 12px">&#xe6ed;</i></a>
                            </div>
                            <div class="clear"></div>
                            <div class="con">
                                <table class="table-hover" cellspacing="0">
                                    <thead>
                                    <tr>
                                        <th>项目代码</th>
                                        <th>项目名称</th>
                                        <th>审批事项</th>
                                        <th>审批结果</th>
                                    </tr>
                                    </thead>

                                    <c:forEach items="${dateByLimit}" var="dateByLimit">
                                        <tr onclick="location.href='${pageContext.request.contextPath}/re_approve/approveInfo?ItemId=${dateByLimit.id}'">
                                            <td style="text-align: left">${dateByLimit.item.code}</td>
                                            <td>${dateByLimit.item.name}</td>
                                            <td>${dateByLimit.message}</td>
                                            <c:choose>
                                                <c:when test="${dateByLimit.status=='3'}">
                                                    <td id="OBTAINRESULT">通&nbsp;&nbsp;&nbsp;过</td>
                                                </c:when>
                                                <c:when test="${dateByLimit.status=='2'}">
                                                    <td id="OBTAINRESULT">待通过</td>
                                                </c:when>
                                                <c:when test="${dateByLimit.status=='1'}">
                                                    <td id="OBTAINRESULT">未通过</td>
                                                </c:when>
                                            </c:choose>
                                        </tr>
                                    </c:forEach>
                                </table>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3 r_frist col-xs-8" id="loginJump">
                        <div class="login">
                            <form>
                                <h3>用户登录</h3>
                                <div class="username">
                                    <img src="${pageContext.request.contextPath}/img/index/Frame 12.png">
                                    <input required type="text" value="${userInfo.name}" placeholder="手机号"
                                           name="Telephone" id="Telephone">
                                </div>
                                <div class="password">
                                    <img src="${pageContext.request.contextPath}/img/index/Frame 13.png">
                                    <input required type="password" value="${userInfo.password}" placeholder="登录密码"
                                           name="passWord" id="passWord">
                                </div>
                                <div class="get">
                                    <div class="g">
                                        <img src="${pageContext.request.contextPath}/img/index/Frame 14.png">
                                        <input required type="text" class="y" placeholder="验证码" name="verificationCode"
                                               id="verificationCode">
                                    </div>
                                    <img id="codeImg1" name="codeImg" alt="点击更换" title="点击更换"
                                         style="float:right;height:30px;width:100px;position:relative;top: -33px;">
                                </div>
                                <button onclick="loginSubmit()" type="button">登录</button>
                                <br>
                            </form>
                            <a href="${pageContext.request.contextPath}/user/regist">用户注册</a>
                            <a href="${pageContext.request.contextPath}/user/forget_password">︱&nbsp忘记密码</a>
                        </div>
                    </div>
                </c:if>
                <c:if test="${userInfo != null}">
                    <div class="col-md-12  col-xs-12">
                        <div class="l_frist">
                            <div class="title">
                                <span class="one">项目办理结果公示</span>
                                <a class="two" href="item/revealFull">更多&nbsp;<i class="iconfont"
                                                                                 style="font-size: 12px">&#xe6ed;</i></a>
                            </div>
                            <div class="clear"></div>
                            <div class="con">
                                <table class="table-hover" cellspacing="0">
                                    <thead>
                                    <tr>
                                        <th>项目代码</th>
                                        <th>项目名称</th>
                                        <th>审批事项</th>
                                        <th>审批结果</th>
                                    </tr>
                                    </thead>
                                    <c:forEach items="${dateByLimit}" var="dateByLimit">
                                        <tr onclick="location.href='${pageContext.request.contextPath}/re_approve/approveInfo?ItemId=${dateByLimit.item.id}'">
                                            <td>${dateByLimit.item.code}</td>
                                            <td>${dateByLimit.item.name}</td>
                                            <td>${dateByLimit.message}</td>
                                            <c:choose>
                                                <c:when test="${dateByLimit.status=='3'}">
                                                    <td id="OBTAINRESULT">通&nbsp;&nbsp;&nbsp;过</td>
                                                </c:when>
                                                <c:when test="${dateByLimit.status=='2'}">
                                                    <td id="OBTAINRESULT">待&nbsp;&nbsp;&nbsp;批</td>
                                                </c:when>
                                                <c:when test="${dateByLimit.status=='1'}">
                                                    <td id="OBTAINRESULT">未通过</td>
                                                </c:when>
                                            </c:choose>
                                        </tr>
                                    </c:forEach>
                                </table>
                            </div>
                        </div>
                    </div>
                </c:if>
            </div>
        </div>

    </div>

    <div class="second">
        <div class="container">
            <div class="second_main">
                <div class="row">
                    <div class="col-md-3 col-xs-6">
                        <div class="con">
                            <span class="img">
                                <img src="${pageContext.request.contextPath}/img/index/Frame 15.png" alt="">
                            </span>
                            <span class="c">
                                <div class="t">审批类申报</div>
                                <button><a href="${pageContext.request.contextPath}/re_approve/item?groupId=1">开始申报</a></button>
                            </span>
                        </div>
                    </div>
                    <div class="col-md-3 col-xs-6">
                        <div class="con">
                          <span class="img">
                            <img src="${pageContext.request.contextPath}/img/index/Frame 16.png" alt="">
                        </span>
                            <span class="c">
                            <div class="t">核准类申报</div>
                            <button><a
                                    href="${pageContext.request.contextPath}/re_approve/item?groupId=2">开始申报</a></button>
                        </span>
                        </div>

                    </div>
                    <div class="col-md-3 col-xs-6">
                        <div class="con">
                            <span class="img">
                            <img src="${pageContext.request.contextPath}/img/index/Frame 17.png" alt="">
                        </span>
                            <span class="c">
                            <div class="t">备案类申报</div>
                            <button><a
                                    href="${pageContext.request.contextPath}/re_approve/item?groupId=3">开始申报</a></button>
                        </span>
                        </div>

                    </div>
                    <div class="col-md-3 col-xs-6">
                        <div class="con">
                            <span class="img">
                            <img src="${pageContext.request.contextPath}/img/index/Frame 18.png" alt="">
                        </span>
                            <span class="c">
                            <div class="t">项目信息</div>
                            <button><a href="${pageContext.request.contextPath}/re_approve/item">查看详情</a></button>
                        </span>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>
    <div class="third container w">
        <div class="th-title">
            <div class="row">
                <div class="col-md-8 col-xs-12 c">
                    <h1>西藏项目申报情况</h1>
                </div>
                <div class="col-md-4 col-xs-12">
                    <div class="address">
                        <div class="dropdown">
                            <span style="font-size: 18px">地区：</span>
                            <div style="display: inline-block">
                                <select class="form-control">
                                    <option>阿里地区</option>
                                    <option>那曲市</option>
                                    <option>日喀则市</option>
                                    <option>拉萨市</option>
                                    <option>山南市</option>
                                    <option>林芝市</option>
                                    <option>昌都市</option>
                                </select>
                            </div>
                        </div>
                        <div class="dropdown">
                            <span style="font-size: 18px">年度：</span>
                            <div style="display: inline-block">
                                <select class="form-control">
                                    <option>2017</option>
                                    <option>2018</option>
                                    <option>2019</option>
                                    <option>2020</option>
                                    <option>2021</option>
                                    <option>2022</option>
                                    <option>2023</option>
                                    <option>2024</option>
                                    <option>2025</option>
                                    <option>2026</option>
                                </select>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>

        <div class="con">
            <div class="row">
                <div class="col-lg-7 col-md-8 col-sm-12">
                    <div class="l_third">
                        <div>
                            <h3>投资项目在线审批监管平台<br>申报项目概览</h3>
                        </div>
                        <%@include file="pub/map.jsp" %>
                    </div>
                </div>
                <div class="col-lg-5 col-md-4 col-sm-12">
                    <div class="r_third">
                        <div class="top">
                            <div class="title">
                                <h1>申报项目情况</h1>
                            </div>
                            <div class="con">
                                <ul style="display: inline-block; width: 60%;">
                                    <li>投资项目总数</li>
                                    <li> 申批类项目</li>
                                    <li> 核准类项目</li>
                                    <li> 备案类项目</li>
                                    <li> 总投资</li>
                                </ul>
                                <ul style="display: inline-block;width: 38%;color: #a5a5a5;">
                                    <li>1945个</li>
                                    <li>1921个</li>
                                    <li>2个</li>
                                    <li>22个</li>
                                    <li>1006.08亿元</li>
                                </ul>
                            </div>
                        </div>
                        <div class="bottom">
                            <div class="title">
                                <h1>申报项目行业TOP5</h1>
                            </div>
                            <div class="surface">
                                <%@include file="pub/pie.jsp" %>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="fourth container w">
        <div class="row  w">
            <div class="col-md-8">
                <div class="l_fourth">
                    <div class="title">
                        <span class="one">新闻资讯</span>
                        <span class="two"><a href="${pageContext.request.contextPath}/user/news">更多&nbsp;&gt;</a></span>
                    </div>
                    <div class="clear"></div>
                    <div class="con">
                        <ul id="ul1">

                        </ul>
                    </div>
                </div>
            </div>
            <div class="col-md-4">
                <div class="r_fourth">
                    <div class="h">
                        <span class="one">中介服务事项及名录</span>
                        <span class="two">更多&nbsp;&gt;</span>
                    </div>
                    <div class="main">
                        <div class="title">
                            <h3>中介服务事项</h3>
                        </div>
                        <div class="con">
                            <ul>
                                <li>项目申请报告编制</li>
                                <li>项目申请报告评估咨询</li>
                                <li>项目申请报告评审建设</li>
                                <li>项目环境影响评价</li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <%@include file="pub/footer.jsp" %>
</div>
</div>
<script src="${pageContext.request.contextPath}/js/md5.js"></script>
<script>
    $(document).ready(function (e) {
        changeCode();
        $("#codeImg1").bind("click", changeCode);
    });

    //加载时间戳，防止浏览器利用缓存
    function genTimestamp() {
        var time = new Date();
        return time.getTime();
    }

    function changeCode() {
        $("img[name='codeImg']").attr("src", "${pageContext.request.contextPath}/validCode/code?t=" + genTimestamp());
    }

    function loginSubmit() {
        var Telephone = $("#Telephone").val();
        var passWord = $("#passWord").val();
        passWord=md5(passWord)
        console.log(passWord);
        var verificationCode = $("#verificationCode").val();
        if (check()) {
            $.ajax({
                type: 'post',
                url: '${pageContext.request.contextPath}/index/userLogin',
                data: {
                    "Telephone": Telephone,
                    "passWord": passWord,
                    "verificationCode": verificationCode
                },
                success: function (result) {
                    /*if(result.result==2){
                        alert(result.msg);
                        location.href = "system/index"
                    }else */
                    if (result.result == 1) {
                        alert(result.msg);
                        history.go(0);
                    } else {
                        alert(result.msg);
                    }
                }
            });
        } else {
            return;
        }
    }

    function check() {
        var Telephone = $("#Telephone").val();
        var passWord = $("#passWord").val();
        var verificationCode = $("#verificationCode").val();
        if (Telephone == null || Telephone == '') {
            alert("用户名不能为空");
            return false;
        } else if (passWord == null || passWord == '') {
            alert("密码不能为空");
            return false;
        } else if (verificationCode == null || verificationCode == '') {
            alert("验证码不能为空");
            return false;
        } else {
            return true;
        }

    }
</script>
<script>
    var p = 2
    $(function () {
        ajaxList(1);
    });

    function ajaxList(page) {

        var departId = $('#title').val();

        $.ajax({
            type: 'get',
            url: "${pageContext.request.contextPath}/user/news/queryList",
            data: {
                "page": page,

                "title": departId
            },
            success: function (result) {

                var rows = result.list;//得到数据列
                var total = result.count;//得到数据总数
                $("#lastPage").val(result.totalPage)
                lastPage = result.totalPage;
                totalCount = total;
                if (page > lastPage) {
                    alert("暂无更多")
                    return
                }
                var html = $("#ul1").html();
                for (var i = 0; i < rows.length; i++) {
                    html += ' <li><a href="${pageContext.request.contextPath}/user/newsDetail?id=' + rows[i].id + '"><span></span>' +
                        rows[i].title + '</li>'
                }
                if (rows.length == 0) {
                    html += '无数据';
                }
                $("#ul1").html(html);


            }
        });
    }

    function next() {
        ajaxList(p++)
    }
</script>
</body>
</html>
